<script src="<?php echo URL::base() ?>media/vendor/js/jquery-1.10.2.js"></script>
<?php
 if (count($lines)){
 	echo implode(',',$lines).'行插入失败';
  }else {
 	echo '数据全部上传成功';
 }?>
<script type="text/javascript">
$(function(){
	 $('.num').each(function(){
	     var num= parseInt($(this).text()); 
	     if(num>0)
	     {
	    	 $(this).css('background-color','green');   
	     }
	     if(num < 0){
	    	 $(this).css('background-color','red'); 
	     }
		 });

});
 </script>
 <style>
  .info span{
   display:inline-block;
   width: 15px;
   height: 15px;
  }
 .yellow{background-color: yellow;}
 .green{background-color: green;}
 .red{background-color: red;}
 
</style>
 <table class="table table-bordered">
              <thead>
                <tr>
                  <th>SKU</th>
                  <th>中文名称</th>
                  <th>储位</th>
                  <th>盘点时间</th>
                  <th>单据下载时间</th>
                  <th>单据上传时间</th>
                  <th>类型</th>
                  <th>下载实际量</th>
                  <th>上传实际量</th>
                  <th>盘点量</th>
                  <th>差异量</th>
                </tr>
              </thead>
              <tbody>
               <?php foreach ($datas as $date ):?>
                <tr>
                  <td><?php echo $date['sku']?> </td>
                  <td><?php echo $date['sku_name'] ?> </td>
                  <td><?php echo $date['storage_position'] ?> </td>
                  <td><?php echo $date['pd_time'] ?></td>
                  <td><?php echo $date['download_time'] ?> </td>
                  <td><?php echo $date['upload_time'] ?> </td>
                  <td><?php echo Pandian::getpandiantpyeByid($date['status'])?></td>
                  <td <?php if($date['quantity3']!= $date['quantity2'])echo "class='yellow'"; ?>><?php echo $date['quantity2'] ?></td>
                  <td <?php if($date['quantity3']!= $date['quantity2'])echo "class='yellow'"; ?>><?php echo $date['quantity3'] ?></td>
                  <td><?php echo $date['quantity'] ?></td>
                  <td class='num'><?php echo $date['num'] ?></td>
                </tr>
                <?php endforeach;?>
              </tbody>
            </table>
<?php echo $pager_links;?>
<div class="info">
<span class="red"></span>红色代表盘亏数量
<span class="green"></span>绿色代表盘赢数量
<span class="yellow"></span>黄色代表上传实际量和下载实际量不一致，说明期间有出入库记录。
</div>
<div>下载实际量：即下载单据时的实际库存量</div>
<div>上传实际量：即上传单据时的实际库存量</div>
